function [infoList,data] = MatStockTestTool(start,timeInDay,days,randRange)
  % MatStockTestTool: 通过随机游走生成测试数据
  % start:开始价格
  % timeInDay:单日内游走次数
  % days:日数
  % randRange:游走幅度
  %
  % infoList {
  %   date:日期
  %   open:开盘价
  %   high:最高价
  %   close:收盘价
  %   low:最低价
  %   volume:成交量
  % }
  % Extended description

  walkTime = timeInDay*days;
  walkChange = (rand(walkTime,1) - 0.5) * 2 * randRange + 1;

  data = cumprod([start;walkChange]);
  data = data(2:end);

  plot(1:walkTime,data);

  data = (reshape(data,timeInDay,days))';

  date = (1:days)';
  open = data(:,1);
  high = max(data,[],2);
  close = data(:,timeInDay);
  low = min(data,[],2);
  volume = zeros(days,1);

  T = table(date,open,high,close,low,volume,'VariableNames',{'date','open','high','close','low','volume'})
  infoList = table2struct(T);

end  % MatStockTestTool
